<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--body自带8px的margin-->
    <style>
        #d1{
            width: 100px;
            height: 100px;
            border: 1px solid red;
            /*顶开自己或别人（有东西的条件下）*/
            margin-left: 100px;
            margin-top: 100px;
            margin-bottom: 50px;

            margin: 50px;
        /*    上下50 左右100：*/
            margin: 50px 100px;
        /*    auto:居中*/
            margin: 0 auto;
        /*    a b c d :上右下左（顺时针）*/
        }
        #d2{
            width: 100px;
            height: 100px;
            border: 1px solid red;
            margin-top: 50px;
        }
        /*行内元素无上下外边距*/
        span{border: 1px solid blue}
        #s1{
            margin-left: 100px;
            margin-right: 30px;
            margin-top: 100px;
            margin-bottom: 100px;
        }
        /*上下方向重复取最大值，左右直接相加*/
        #s2{
            margin-left: 20px;
        }
        #big{
            width: 200px;
            height: 200px;
            background-color: red;

            overflow: hidden;

        }
        #big>div{
            width: 50px;
            height: 50px;
            background-color: green;
            margin-left: 100px;

            margin-top: 100px;
        /*    边线重叠，整体下移。解决方法：overflow*/
        }
    </style>
</head>
<body>
<div id="big">
    <div></div>
</div>
<span id="s1">span1</span><span id="s2">span2</span>
<div id="d1"></div>
<div id="d2"></div>


</body>
</html>